﻿using Domain.Entity;
using Domain.Entity.sys;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.StockWarningService
{
    public class StockWarningService : IStockWarningService
    {
        private readonly IStockRepository stockRepository;
        private readonly IStockWarningRepository stockWarningRepository;

        public StockWarningService(IStockWarningRepository stockWarningRepository)
        {
            this.stockWarningRepository = stockWarningRepository;
        }

        //检查预警
        public Task CheckWarning()
        {
            return stockWarningRepository.CheckWarning();
        }


        //到期预警
        public Task ExpirationWarning()
        {
            return stockWarningRepository.ExpirationWarning();
        }


        //分页查询
        public async Task<FenYe<StockWarning>> GetStockWarning(FenYe<StockWarning> fenYe, string? name, string? type, string? warning, int? startnum, int? endnum)
        {
            return await stockWarningRepository.GetStockWarning(fenYe, name, type, warning, startnum, endnum);
        }
    }
}
